package cn.getech.data.development.constant;

import lombok.Getter;

@Getter
public enum TableRegisterTypeEnum {
    /**
     * 注册类型 1:数仓添加 2:数仓修改 3:数仓删除 4:仓库同步
     * 5:实时表添加  6:实时表修改 7 实时表删除
     */
    //0 未采集 1采集中  2 采集成功 3 采集失败,
    OFFLINE_ADD(1,"数仓添加"),
    OFFLINE_UPDATE(2,"数仓修改"),
    OFFLINE_DELETE(3,"数仓删除"),
    OFFLINE_SYN(4,"仓库同步"),
    ONLINE_ADD(5,"实时表添加"),
    ONLINE_UPDATE(6,"实时表修改"),
    ONLINE_DELETE(7,"实时表删除");

    private Integer code;
    private String name;

    TableRegisterTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }
    public static String getTypeName(Integer code) {
        if (code != null ) {
            for (TableRegisterTypeEnum value : TableRegisterTypeEnum.values()) {
                if (value.getCode().equals(code)) {
                    return value.getName();
                }
            }
        }
        return null;
    }
}
